[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
twDBrowse( wT, wL, wB, wR, aColumns, cTitle, Footers,;
bTopBlock, bBotBlock, bScopeBlock, lEditFlag,;
aActionKeys, wColor, wSType, wFType, wFColor,;
lScBar, lMsgs, lAlite, nFreeze, lStabilize )
----------------------------------------------------------------------------
Display and handle keystrokes for a TBrowse defined on the
currently selected database file. All parameters have defaults. By
allowing the function to set them, twDBrowse() operates similarly
to DBedit(), but with superior keystroke defaults.
Record scoping is supported in twDBrowse().
The TBrowse processes the following keys:
Up Arrow ---------+
Down Arrow |
Left Arrow |
Right Arrow |
Page Down |- Scroll the Highlight Bar in
Page Up | the normal way.
Ctrl Page Down |
Ctrl Page Up |
Ctrl Left Arrow |
Ctrl Right Arrow |
Ctrl Home |
Ctrl End ---------+
Escape - Exit with no choice.
Enter - If EditFlag is .T., allow editing of
the current field in the current
record, otherwise, exit the browse.
Delete - Mark the current record for deletion.
Alpha Keys - Speed Search with display of key.
F1 - Display default keystroke handling.
F8 - Swap current column with the one on
the left.
F7 - Delete the current column from the
display.
F9 - Subtract one to the count of columns
on the left which are frozen. The
freeze value defaults to 0.
F10 - Add one to the count of columns
on the left which are frozen. The
freeze value defaults to 0.
Arguments:
wT, wL - 'N' Screen coordinates for the display
wB, wR window.
aColumns - 'A' An array containing as its elements the TBrowse
columns to display. If this parameter is not
passed, it defaults to creating columns for every
field in the currently selected database file.
cTitle - 'C' Header for the display window. The default is
NIL.
Footers - 'C' Footer for the display window. The default is
NIL.
bTopBlock - 'B' Code block to define the top record in the scope.
Defaults to BOF().
bBotBlock - 'B' Code block to define the bottom record in the
scope. Defaults to EOF().
bScopeBlock- 'B' Code block to define records in the scope.
Defaults to {|| RECNO() <> NIL }.
lEditFlag - 'L' Allow/disallow editing in the DBedit() manner.
Append is NOT supported in this version.
aActionKeys- 'A' This optional parameter allows you to require
twDBrowse() to execute external code WITHOUT
exiting the browse. The operation is similar to
that used in the Alert Class.
Each element in the array must have two elements,
the first to indicate which key you wish to use
to invoke the external code, the second, a code
block to execute when that key is pressed.
ActionKeys can be used to override the default
keystroke handling in twDBrowse(), ie., if you
don't like what K_F8 does, pass in code to
replace it in the ActionKeys Array.
wColor - 'C' Clipper colour string. Defaults to SETCOLOR(). It
is suggested that you pass a colour string with
the Clipper background colour set. If you do,
that colour is used for frozen columns.
wSType - 'N' TSDWIN shadow type. Defaults to no shadow.
wFType - 'N' TSDWIN frame type. Defaults to single line box.
wFColor - 'C' Optional border colour. Can be used to make the
active window, in this case the browse, have a
different border colour from other windows.
lScBar - 'L' Logical to indicate whether or not to display a
scrollbar in the display window. Please be warned
that when using dynamic searching, the scrollbar
may not be properly updated. This deficiency will
be corrected in a later version.
lMsgs - 'L' Logical to indicate whether or not to display
configuration messages during the display for
users' information.
lALite - 'L' Logical to indicate whether or not to use field
pointing for the highlight or to disable it and
highlight an entire row of the display.
nFreeze - 'N' Number of columns to freeze initially. The
default is zero.
lStabilize - 'L' Logical to allow for control of browse
stabilization:
.T. - allow keypresses to interrupt
.F. - browse must be stable before
accepting keypresses.
Return:
Current Record Number, or zero for exit without selection.
Example:
FUNCTION main()
local TopBlock, BotBlock, ScopeBlock
LOCAL wT := 3, wL := 10, wB := 20, wR := 60
LOCAL wColor := "w+/rb,b/w,,,w/rb", wSType := 3, wFType := 4
LOCAL Editflag := .T.
LOCAL columns := NIL, ActionKeys := NIL, Footers := NIL
FIELD codekey, codeShort:, continent
CLS
SET CURSOR OFF
SET SCOREBOARD OFF
SET DELETED ON
USE windemo INDEX windemo ALIAS test NEW
TopBlock := {|| codekey = "B" }
BotBlock := {|| codekey = "P" }
ScopeBlock := {|| codekey >= "B" .AND. codekey <= "P" }
// position record pointer within scope
go top
seek "B"
columns := {}
AADD( Columns, TBColumnNew( "Code;Key", FIELDBLOCK( "codekey" ) ))
AADD( Columns, TBColumnNew( "Code;Description", ;
FIELDBLOCK( "codeShort:" ) ))
twdBrowse( wT, wL, wB, wR, columns, footers, TopBlock, ;
BotBlock, ScopeBlock, EditFlag, ActionKeys, ;
wColor, wSType, wFType, .T., .T. )
Compile link and run the DBR.PRG demo. More examples will be
available on the TSDWIN Support BBS.
See Also:
twGetaBrowse()
twGetCurElem()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson